﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Simple.Common.Data;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Simple.Entity.Enums;

namespace Simple.ViewModel
{
    public class MenuDto : Dto<long>
    {
        /// <summary>
        /// 菜单名称
        /// </summary>
        [Required(ErrorMessage = "菜单名称不能为空")]
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string MenuName { get; set; }

        /// <summary>
        /// 控制器名称
        /// </summary>
        [Required(ErrorMessage = "Controller名称不能为空")]
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string ControllerName { get; set; }

        /// <summary>
        /// 动作名称
        /// </summary>
        [Required(ErrorMessage = "Action名称不能为空")]
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string ActionName { get; set; }

        /// <summary>
        /// 菜单类型【菜单模块 1，菜单 2，菜单按钮 3】
        /// </summary>
        public int MenuType { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string Icon { get; set; }

        /// <summary>
        /// 父Id
        /// </summary>
        [Required(ErrorMessage = "所属模块不能为空")]
        public long? ParentId { get; set; }

        /// <summary>
        /// 按钮类型
        /// </summary>
        [Required(ErrorMessage = "请选择按钮类型")]
        public ActionTypeEnum ActionType { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [Required(ErrorMessage = "请设置排序值")]
        [RegularExpression("^[0-9]+$",ErrorMessage="请输入非负数字")]
        public int Sort { get; set; }

        /// <summary>
        /// 菜单列表
        /// </summary>
        public IList<SelectListItem> MenuList { get; set; }

        /// <summary>
        /// 模块列表
        /// </summary>
        public IList<SelectListItem> ModularMenuList { get; set; }

        /// <summary>
        /// 按钮类型列表
        /// </summary>
        public IList<SelectListItem> ActionTypeList { get; set; }
    }
}
